package com.myc.cloud.invoker.Controller;

import com.myc.cloud.invoker.service.feign.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @Classname MyController
 * @Description
 * @Date 2020-08-23 15:49
 * @Created by myc
 */
@RestController
public class MyController {


    @Autowired
    RestTemplate restTemplate;
    @Autowired
    HelloService helloService;

    @GetMapping("/router")
    public Object router(){
//        String json = restTemplate.getForObject("http://provider/hello",String.class);
//        return "invoker: "+json;

        System.out.println("invoker hello");
        return helloService.sayHello("invoker");
    }
}
